package br.unicamp.ic.sgct.server.dominio.entidades;

import it.biobytes.ammentos.AutomaticType;
import it.biobytes.ammentos.FieldTypeEnum;
import it.biobytes.ammentos.PersistentEntity;
import it.biobytes.ammentos.PersistentField;
import it.biobytes.ammentos.PersistentList;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import br.unicamp.ic.sgct.client.dominio.to.InscricaoTO;
import br.unicamp.ic.sgct.client.dominio.to.SessaoTO;
import br.unicamp.ic.sgct.client.dominio.to.UsuarioTO;

//Adicionada
@SuppressWarnings("serial")
@PersistentEntity(sourceDomain = "T_INSCRICAO", primaryKey = "id_inscricao")
public class Inscricao implements Serializable {
	public static final String PERSISTENCE_DOMAIN = "T_INSCRICAO";

	@PersistentField(fieldName="id_inscricao", automatic=true, automaticType=AutomaticType.FRAMEWORK)
	private long idInscricao;

	@PersistentField(type=FieldTypeEnum.DATE)
	private Date dataInscricao;

	@PersistentField(fieldName="id_usuario", type=FieldTypeEnum.ENTITY)
	private Usuario usuario;

	@PersistentField(fieldName="id_sessaoconf", type=FieldTypeEnum.ENTITY)
	private Sessao sessao;
	
	@PersistentField(fieldName="status", type=FieldTypeEnum.INTEGER)
	private int status;
	
	public Date getDataInscricao() {
		return dataInscricao;
	}

	public void setDataInscricao(Date dataInscricao) {
		this.dataInscricao = dataInscricao;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public Sessao getSessao() {
		return sessao;
	}

	public void setSessao(Sessao sessao) {
		this.sessao = sessao;
	}
	public Inscricao() {
		super();
	}

	public Inscricao(UsuarioTO usuario, SessaoTO sessao, Date dataInscricao) {
		this.usuario = new Usuario(usuario);	
		this.sessao = new Sessao(sessao, new Conferencia(sessao.getConferencia()));
		this.dataInscricao = dataInscricao;
		this.status = 0;
	}

	public long getIdInscricao() {
		return idInscricao;
	}

	public void setIdInscricao(long idInscricao) {
		this.idInscricao = idInscricao;
	}

	public Date getDataInscr() {
		return dataInscricao;
	}

	public void setDataInscr(Date dataInscricao) {
		this.dataInscricao = dataInscricao;
	}

	public Usuario getUsuario() {
		return usuario;
	}

	public void setUsuario(Usuario usuario) {
		this.usuario = usuario;
	}
}